package com.cloud.form.api.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cloud.form.api.entity.FormDataPush;
import com.cloud.form.api.service.FormDataPushService;
import com.cloud.form.common.result.Quokka;

@RestController
@RequestMapping("/form/api/formdatapush")
public class FormDataPushController {
	
	@Autowired
	private FormDataPushService formDataPushService;
	
	@RequestMapping("list")
	public Quokka listDataPush(long formId){
		return new Quokka(true, formDataPushService.listDataPush(formId));
	}
	
	@RequestMapping("detail")
	public Quokka detail(long id){
		return new Quokka(true, formDataPushService.showDetail(id));
	}
	
	@RequestMapping("delete")
	public Quokka delete(long id){
		return new Quokka(true, formDataPushService.delete(id));
	}
	
	@RequestMapping("createupdate")
	public Quokka createUpdate(@RequestBody FormDataPush dataPush){
		return new Quokka(true, formDataPushService.createUpdate(dataPush));
	}
	
}
